
function NeuronInput(value) {
	/* ref.number of the parent neuron */
	this.n;
	/* ref.number of the neuron to be connected as the parent's input */
	this.i;
	/* connection weight (optional) */
	this.w = 1.0;

	if (value.length > 0) {
		var position = "0";

		var tmp = value.split(":");
		var data = tmp[1];

		if (tmp.length > 2) // if there was more ":"
			for (i = 2; i < tmp.length; i++)
				data += ":" + tmp[i];

		var info = data.split(",");

		for (var i = 0; i < info.length; i++) {
			var str = info[i];
			if (str.indexOf("\"") > -1) {
				while ((str.split("\"").length % 2) == 1)
					str += "," + info[++i];
			}

			str = str.trim();

			if (str == "")
				position = nextNeuronInput(position);
			else {
				var value;

				if ((str.indexOf("\"") > 1 || str.indexOf("\"") == -1)
						&& str.indexOf("=") > -1) {
					position = str.split("=")[0];
					value = str.split("=")[1];
				} else {
					position = nextNeuronInput(position);
					value = str;
				}

				switch (position) {
				case 'n':
					this.n = value;
					break;
				case 'i':
					this.i = value;
					break;
				case 'w':
					this.w = value;
					break;
				default:
					alert("error");
				}
			}
		}

	}

}